<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="com.etc.myblog.entity.User"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<script type="text/javascript" src="${pageContext.request.contextPath}/resource/js/jquery1.4.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/resource/js/dyfrom.js"></script>
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/resource/css/tzjg_write.css" />
<script type="text/javascript" src="${pageContext.request.contextPath}/resource/js/function.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/resource/js/tzjg_write.js"></script>
<title>密码修改</title>
<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
</head>

<body>
	<%
		User user = (User)session.getAttribute("user");
	%>
	<jsp:include page="../inc/head_nav.jsp" />

	<div class="label-div b-30 border-all pt-5 t-20"
		style="position: relative; padding-left: 0;">
		<div class="txmd">
			<h4 class="mmh4">密码修改页面</h4>
			<form id="pwdModform" action="${pageContext.request.contextPath}/UserSer?tag=pwdModify" method="post">
				<div class="basic">密码修改</div>
				<!-- 验证用户 -->
				<div class="control-group">
					<label class="control-label" for="inputName">账号
						<p class="text-error">您的账号</p>
					</label>
					<div class="controls">
<!-- 					<label id="username" name="username" class="input-xlarge placeholder on" maxlength="10"  value="">
					</label> -->
						 <input id="inputName_Read" type="text" name="username_Read" value="<%=user.getUserName() %>"
							placeholder="" class="input-xlarge placeholder on"
							maxlength="10" rel="input-text" readonly>  <span
							class="help-inline"></span>
					</div>
					<div class="mmclear"></div>
				</div>

				<!-- 验证密码 -->
				<div class="control-group">
					<label class="control-label" for="inputPwd">账号密码
						<p class="text-error">必填项</p>
					</label>
					<div class="controls">
						<input id="inputPwd" type="password" name="userPwd"
							placeholder="你原来的密码" class="input-xlarge placeholder on"
							maxlength="10" rel="input-text"> <span
							class="help-inline"></span>
					</div>
					<div class="mmclear"></div>
				</div>
				<!-- 更改的密码 -->
				<div class="control-group">
					<label class="control-label" for="inputNewPwd">重置的账号密码
						<p class="text-error">必填项</p>
					</label>
					<div class="controls">
						<input id="inputNewPwd" type="password" name="userNewPwd"
							placeholder="你的新密码" class="input-xlarge placeholder on"
							maxlength="10" rel="input-text"> <span
							class="help-inline"></span>
					</div>
					<div class="mmclear"></div>
				</div>
				<!-- 确认更改的密码 -->
				<div class="control-group">
					<label class="control-label" for="inputNewRePwd">再一次确认密码
						<p class="text-error">必填项</p>
					</label>
					<div class="controls">
						<input id="inputNewRePwd" type="password" name="userRePwd"
							placeholder="你的新密码Again" class="input-xlarge placeholder on"
							maxlength="10" rel="input-text"> <span
							class="help-inline"></span>

					</div>
					<div class="mmclear"></div>
				</div>
			</form>
		</div>
		<div class="basic"
			style="border-top:1px solid #ccc; text-align:right; margin-left:15px; padding:10px 0px 5px 0px;">
			<input type="image" src="${pageContext.request.contextPath}/resource/images/blutbottom.jpg" value="" onclick="submit_form(this)"
				style="width:81px; height:46px;" />
		</div>
	</div>
<script type="text/javascript">
$('input').keydown(function(event){  
	if(event.keyCode == 13)submit_form('.login-register-btn');
}); 

var submit_form = function(obj) {
	 updatePwd();
};


//网站后台注册
updatePwd = function(){
	if(!dyfrom_null($('#inputNewPwd').val())){
		alert('密码不能为空');
		return false;
	 }
	if(!dyfrom_null($('#inputNewRePwd').val())){
		alert('请再次输入密码');
		return false;
	 }
	if($('#inputNewPwd').val() != $('#inputNewRePwd').val()){
		alert('两次密码不一致');
		return false;
	}
	document.getElementById("pwdModform").submit();
	return true;
};
</script>
<jsp:include page="../inc/footer_nav.jsp"></jsp:include>	
</body>
</html>
